package com.meida.paotui.bus.provider.service.impl;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.meida.common.mybatis.base.service.impl.BaseServiceImpl;
import com.meida.common.security.OpenHelper;
import com.meida.paotui.bus.client.entity.BusIdentity;
import com.meida.paotui.bus.provider.mapper.BusIdentityMapper;
import com.meida.paotui.bus.provider.service.BusIdentityService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 实名认证表 实现类
 *
 * @author flyme
 * @date 2019-10-31
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class BusIdentityServiceImpl extends BaseServiceImpl<BusIdentityMapper, BusIdentity> implements BusIdentityService {


    public BusIdentity save(String userName, String cardNo, String  cardNoImg, String  cardNoImg2,String userType) {

        BusIdentity identity = new BusIdentity();
        identity.setIdentityId(IdWorker.getId());
        identity.setUserName(userName);
        identity.setUserId(OpenHelper.getUserId());
        identity.setCardNo(cardNo);
        identity.setUserType(userType);
        identity.setCardNoImg(cardNoImg);
        identity.setCardNoImg2(cardNoImg2);
        identity.setIsPass(2);
        save(identity);
        return identity;
    }
    public BusIdentity saveidentity(String userName,String cardNo,String license,String overdoor,String userType) {
        BusIdentity identity = new BusIdentity();
        identity.setIdentityId(IdWorker.getId());
        identity.setUserName(userName);
        identity.setUserId(OpenHelper.getUserId());
        identity.setCardNo(cardNo);
        identity.setUserType(userType);
        identity.setLicense(license);
        identity.setOverdoor(overdoor);
        identity.setIsPass(2);
        save(identity);
        return identity;
    }


}
